import { get, post } from '@/utils/request'

const prefix = 'coupon'

export default {
  default: () => {
    return get(`${prefix}/default`)
  },
  seckillConfig: () => {
    return get(`${prefix}/seckill/update`)
  },
  updateSeckill: data => {
    return post(`${prefix}/seckill/update`, data)
  },
  couponConfig: id => {
    return get(`${prefix}/default/update`, {
      id: id
    })
  },
  updateCoupon: (data, id) => {
    return post(`${prefix}/default/update?id=${id}`, data)
  },
  setItems: (data, id) => {
    return post(`${prefix}/items/update?id=${id}`, data)
  },
  grant: data => {
    return post(`${prefix}/grant/user`, data)
  },
  goods: params => {
    return get(`${prefix}/goods/index`, params)
  }
}
